3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D provides routines that you can use to configure matrices to be used as geometric transformations. You must already have allocated the memory for a matrix before calling one of these routines.
All functions operating on 3-by-3 matrices assume that the resulting transform matrices are to be used to transform only homogeneous two-dimensional data types (such as TQ3RationalPoint3D ). Similarly, all functions operating on 4-by-4 matrices assume that the resulting transform matrices are to be used to transform only homogeneous three-dimensional data types (such as TQ3RationalPoint4D ).
You specify an angle (for example, for Q3Matrix3x3_SetRotateAboutPoint ) by passing a value that is interpreted in radians. If you prefer to use degrees, QuickDraw 3D provides C language macros that convert radians into degrees.
You can use the Q3Matrix3x3_SetTranslate function to configure a 3-by-3 translation transformation matrix.
TQ3Matrix3x3 *Q3Matrix3x3_SetTranslate (
TQ3Matrix3x3 *matrix3x3,
float xTrans,
float yTrans);
You can use the Q3Matrix3x3_SetScale function to configure a 3-by-3 scaling transformation matrix.
TQ3Matrix3x3 *Q3Matrix3x3_SetScale (
TQ3Matrix3x3 *matrix3x3,
float xScale,
float yScale);
You can use the Q3Matrix3x3_SetRotateAboutPoint function to configure a 3-by-3 rotation transformation matrix.
TQ3Matrix3x3 *Q3Matrix3x3_SetRotateAboutPoint (
TQ3Matrix3x3 *matrix3x3,
const TQ3Point2D *origin,
float angle);
You can use the Q3Matrix4x4_SetTranslate function to configure a 4-by-4 translation transformation matrix.
TQ3Matrix4x4 *Q3Matrix4x4_SetTranslate (
TQ3Matrix4x4 *matrix4x4,
float xTrans,
float yTrans,
float zTrans);
The Q3Matrix4x4_SetTranslate function returns, as its function result and in the matrix4x4 parameter, a transformation matrix that translates an object by the amount xTrans along the x coordinate axis, by the amount yTrans along the y coordinate axis, and by the amount zTrans along the z coordinate axis.
You can use the Q3Matrix4x4_SetScale function to configure a 4-by-4 scaling transformation matrix.
TQ3Matrix4x4 *Q3Matrix4x4_SetScale (
TQ3Matrix4x4 *matrix4x4,
float xScale,
float yScale,
float zScale);
The Q3Matrix4x4_SetScale function returns, as its function result and in the matrix4x4 parameter, a scaling matrix that scales an object by the amount xScale along the x coordinate axis, by the amount yScale along the y coordinate axis, and by the amount zScale along the z coordinate axis.
You can use the Q3Matrix4x4_SetRotateAboutPoint function to configure a 4-by-4 rotation transformation matrix.
TQ3Matrix4x4 *Q3Matrix4x4_SetRotateAboutPoint (
TQ3Matrix4x4 *matrix4x4,
const TQ3Point3D *origin,
float xAngle,
float yAngle,
float zAngle);
You can use the Q3Matrix4x4_SetRotateAboutAxis function to configure a 4-by-4 rotate-about-axis transformation matrix.
TQ3Matrix4x4 *Q3Matrix4x4_SetRotateAboutAxis (
TQ3Matrix4x4 *matrix4x4,
const TQ3Point3D *origin,
const TQ3Vector3D *orientation,
float angle);
You can use the Q3Matrix4x4_SetRotate_X function to configure a 4-by-4 transformation matrix that rotates objects around the x axis.
TQ3Matrix4x4 *Q3Matrix4x4_SetRotate_X (
TQ3Matrix4x4 *matrix4x4,
float angle);
You can use the Q3Matrix4x4_SetRotate_Y function to configure a 4-by-4 transformation matrix that rotates objects around the y axis.
TQ3Matrix4x4 *Q3Matrix4x4_SetRotate_Y (
TQ3Matrix4x4 *matrix4x4,
float angle);
You can use the Q3Matrix4x4_SetRotate_Z function to configure a 4-by-4 transformation matrix that rotates objects around the z axis.
TQ3Matrix4x4 *Q3Matrix4x4_SetRotate_Z (
TQ3Matrix4x4 *matrix4x4,
float angle);
You can use the Q3Matrix4x4_SetRotate_XYZ function to configure a 4-by-4 transformation matrix that rotates objects around all three coordinate axes.
TQ3Matrix4x4 *Q3Matrix4x4_SetRotate_XYZ (
TQ3Matrix4x4 *matrix4x4,
float xAngle,
float yAngle,
float zAngle);
You can use the Q3Matrix4x4_SetRotateVectorToVector function to configure a 4-by-4 transformation matrix that rotates objects around the origin in such a way that a transformed vector matches a given vector.
TQ3Matrix4x4 *Q3Matrix4x4_SetRotateVectorToVector (
TQ3Matrix4x4 *matrix4x4,
const TQ3Vector3D *v1,
const TQ3Vector3D *v2);
You can use the Q3Matrix4x4_SetQuaternion function to configure a 4-by-4 quaternion transformation matrix.
TQ3Matrix4x4 *Q3Matrix4x4_SetQuaternion (
TQ3Matrix4x4 *matrix,
const TQ3Quaternion *quaternion);
Previous | QD3D Book | Overview | Chapter Contents | Next |